package service

import (
	"gorm.io/gorm"
	"template-generate/db"
)

type DirService struct {
	db *gorm.DB
}

func (s *DirService) List() []db.Dir {
	var dirs []db.Dir
	s.db.Model(&db.Dir{}).Order("sort_num desc").Find(&dirs)
	return dirs
}
